<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>postMessage2</title>
</head>
<body>
<p id="iframeIdFile2">这是postMessage2文件</p>
<script>
  let obj = {
    name: '张三',
    age: 13
  }
  window.top.postMessage(obj);
  function frameFun2() {
    console.log('这是iframe2文件内容');
  }
  // 通过top或parent对象获取父页面的window对象
  // parent.window.parentFun1();
  // let parentId = top.window.document.getElementById('parpentId');
  // console.log(parentId);
</script>
</body>
</html>